<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>编辑地址</title>
    <style>.form-group { margin: 10px; }</style>
</head>
<body>
<h2>编辑地址</h2>
<form action="/addresses//{addressId}/edit" method="post">
    <input type="hidden" name="_method" value="PUT">
    <input type="hidden" name="userId" value="${userId}">

    <div class="form-group">
        <label>收件人：</label>
        <input type="text" name="accept" value="${address.accept}" required>
    </div>
    <div class="form-group">
        <label>联系方式：</label>
        <input type="tel" name="telphone" value="${address.telphone}" required>
    </div>
    <div class="form-group">
        <label>省份：</label>
        <input type="text" name="province" value="${address.province}" required>
    </div>
    <div class="form-group">
        <label>城市：</label>
        <input type="text" name="city" value="${address.city}" required>
    </div>
    <div class="form-group">
        <label>区域：</label>
        <input type="text" name="area" value="${address.area}" required>
    </div>
    <div class="form-group">
        <label>街道：</label>
        <input type="text" name="street" value="${address.street}" required>
    </div>
    <div class="form-group">
        <label>默认地址：</label>
        <select name="def">
            <option value="1" ${address.def == '1' ? 'selected' : ''}>是</option>
            <option value="0" ${address.def == '0' ? 'selected' : ''}>否</option>
        </select>
    </div>
    <button type="submit" class="btn">保存修改</button>
</form>
</body>
</html>